home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Source / MiscGISKit / MiscUKUTMCoord.m < prev    next >
Text File  |  1995-07-20  |  2KB  |  78 lines

  1. /*============================= MiscUKUTMCoord.m ============================*/
  2. /* MiscUKUTMCoord class contains and supports values representing locations
  3.    in the UK National Grid Universal Transverse Mercator coordinate system
  4.    as of March 1983.
  5.  
  6.    DMA Release 0.8, Copyright @1993 by Genesis Project, Ltd. All Rights
  7.    Reserved. For further information on terms and conditions see:
  8.         Documentation/GISKit/Agreements-Legal-README
  9.  
  10. HISTORY
  11. 26-Mar-93  Dale Amon at GPL
  12.        Created.
  13. */
  14.  
  15. #import <misckit/miscgiskit.h>
  16.  
  17. @implementation MiscUKUTMCoord
  18.  
  19. /*===========================================================================*/
  20. /* Internal methods */
  21. /*===========================================================================*/
  22.  
  23. static id theUKGrid = nil;
  24.  
  25. + makeGrid
  26.   {
  27.     if (!theUKGrid)
  28.     {theUKGrid = [[MiscUTMConstants allocFromZone: [self zone]]
  29.                initGridName: "UK National Grid"
  30.              trueOrigin: 49.0 : -2.0
  31.                  inGrid: 400000.0    : -100000.0
  32.                onSphere: 6377563.396 : 6356256.910
  33.          centralMeridianScaling: 0.9996012717];
  34.      [theUKGrid setProtected];
  35.     }
  36.     return theUKGrid;
  37.   }
  38.  
  39.  
  40. /*===========================================================================*/
  41. /* Initialization methods. If we don't already have a UTM constants object
  42.    for the UK National Grid, create one instance that all will share and that
  43.    cannot be deleted.
  44.  
  45.    Constants are from the UK Ordinance Survey document, "Transverse Mercator
  46.    Projection, Constants, Formula and Methods", March 1983
  47.  
  48. */
  49. /*===========================================================================*/
  50. /* DESIGNATED INITIALIZER */
  51.  
  52. -initDescription: (char *) txt
  53.  {return [super initDescription: txt constants: [MiscUKUTMCoord makeGrid]];}
  54.  
  55.  
  56. /*---------------------------------------------------------------------------*/
  57. /* Block the designated initializer of our parent class */
  58.  
  59. -initDescription: (char *) txt constants: anObject
  60.  {    [self error:"  %s class should not be sent '%s' messages\n",
  61.             [[self class] name], sel_getName(_cmd)];
  62.     return self;
  63.  }
  64.  
  65.  
  66. /*===========================================================================*/
  67. /* Archive methods */
  68. /*===========================================================================*/
  69. - awake
  70. {    [super awake];
  71.     [constants setUnprotected];
  72.     [constants free];
  73.     [MiscUKUTMCoord makeGrid];
  74.     return self;
  75. }
  76.  
  77. @end
  78.